package praktikumid.w05.p1;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class CompareDates {

	public static void main(String[] args) throws ParseException {
		if (args.length != 2) {
			System.out.println("usage: java -jar CompareDates \"2013-09-12T12:50:11.12Z\" \"2013-09-12T12:50:11.12Z\"");
			System.exit(0);
		}
		
		
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SS'Z'");
		Date d1 = sdf.parse(args[0]);
		Date d2 = sdf.parse(args[1]);
		//String dateString = "2013-09-12T12:50:11.12Z";
		//sdf.parse(dateString);
		
		if (d1.before(d2)) {
			System.out.println("Yes, the first date is earlier");
		} else {
			System.out.println("No, the first date is not earlier");
		}

	}

}
